<template lang="pug">
a(:href='href', v-if='value') {{value.name}}
span(v-else) 未知
</template>
<script>
export default {
  name: 'UserLink',
  props: {
    value: {
      name: String,
      _id: String
    }
  },
  computed: {
    text () {
      return this.value ? this.value.name : '未知'
    },
    href () {
      return this.value ? `#/users/id/${this.value._id}` : '#'
    }
  }
}
</script>

